<?php
class ActionsModule extends fvModule {

	function __construct () {
	    $moduleName = strtolower(substr(__CLASS__, 0, -6));
	    parent::__construct(fvSite::$fvConfig->get("modules.{$moduleName}.smarty.template"), 
	                        fvSite::$fvConfig->get("modules.{$moduleName}.smarty.compile"), 
	                        fvSite::$Layoult);
	}
	
	function showIndex($params) {
		$pager = new fvPager(PresscenterManager::getInstance());
	    $this->__assign(
	    	array(
	    		'Presscenter' => $pager->paginate("type='action' and lang='".fvSite::$fvSession->get("lang")."'", "create_date DESC") , 
	    	)
	   	);
        return $this->__display("actions_index.tpl");
	}
	
	function showOne($params) {
	    $request = fvRequest::getInstance();
        if (!$Presscenter = PresscenterManager::getInstance()->getByPk($request->getRequestParameter('id'))) {
            $Presscenter = new Presscenter();
            
        }
        $this->__assign(array(
            'Presscenter' => $Presscenter,
        ));
        return $this->__display('actions_one.tpl');
	}
	
}
?>